import { Module } from '@nestjs/common';
import { CatsController } from './cats.controller';
import { CatsService } from './cats.service';
import { APP_PIPE, APP_GUARD } from '@nestjs/core';
import { ValidationPipe } from 'src/pipes/validation.pipe';
import { RolesGuard } from 'src/guards/roles.guard';
@Module({
  controllers: [CatsController],
  providers: [
    CatsService,
    // 从任何模块设置全局管道
    {
      provide: APP_PIPE,
      useClass: ValidationPipe,
    },
    // 从任何模块设置全局守卫
    {
      provide: APP_GUARD,
      useClass: RolesGuard,
    },
  ],
})
export class CatsModule {}
